package v1

import (
	"net/http"
	"toy-car/models"
	"toy-car/pkg/e"

	"github.com/gin-gonic/gin"
)

// @Tags Jwt
// @Summary jwt加入黑名单
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Success 200 {string} string "{"success":true,"data":{},"msg":"拉黑成功"}"
// @Router /jwt/jsonInBlacklist [post]
func JsonInBlacklist(c *gin.Context) {
	token := c.Request.Header.Get("X-TOY_TOKEN")
	jwt := models.JwtBlacklist{Jwt: token}
	code := e.SUCCESS
	c.JSON(http.StatusOK, gin.H{
		"code": code,
		"msg":  e.GetMSG(code),
		"data": jwt,
	})
}
